// ml:run = time -p $bin < input
#include <iostream>
#include <vector>

using ll = long long;
ll const maxp = 1000000;
ll sum[maxp];
bool p[maxp * 2];
ll n;

std::vector<ll> primes;

ll pi(ll x);

ll dp(ll x, ll k)
{
    if (x <= 0) return 0;
    if (!k) return x;
    if (primes[k - 1] * primes[k - 1] >= x)
        return pi(x) - k + 1;
    return dp(x, k - 1) - dp(x / primes[k - 1], k - 1);
}

ll pi(ll x)
{
    if (x < maxp) return sum[x];
    ll tmp3 = 1, tmp2 = 1;
    while (tmp3 * tmp3 * tmp3 <= x) tmp3++;
    while (tmp2 * tmp2 <= x) tmp2++;
    tmp3--; tmp2--;
    ll tsum = 0;
    for (ll i = tmp3 + 1; i <= tmp2; i++)
        if (!p[i])
            tsum += pi(x / i) - pi(i) + 1;
    return dp(x, sum[tmp3]) + sum[tmp3] - tsum - 1;
}

void init()
{
    for (int i = 2; i < maxp; i++)
        if (!p[i]) {
            sum[i]++;
            primes.push_back(i);
            for (int j = maxp / i; j >= i; j--)
                p[i * j] = true;
        }

    for (int i = 3; i < maxp; i++)
        sum[i] += sum[i - 1];
}

int main()
{
    std::ios_base::sync_with_stdio(false);
    init();
    while (std::cin >> n) {
        std::cout << pi(n) << "\n";
    }
}

